﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Little_Tower_Defense.Builings
{
    class SimpleTower : DrawableGameComponent, IBuilding
    {
        public LittleTowerDefense Game;
        Level level;
        public int PositionX { get; set; }
        public int PositionY { get; set; }
        public int Cost { get; set; }
        Texture2D texture;

        private SimpleTower(LittleTowerDefense game)
            : base(game)
        {
            // Niemals aufrufen
        }

        public SimpleTower(LittleTowerDefense game, Level level, int positionX, int positionY)
            : base(game)
        {
            this.Game = game;
            this.level = level;
            this.PositionX = positionX;
            this.PositionY = positionY;
            this.Cost = 0;
        }

        public override void Initialize()
        {
            base.Initialize();
        }

        protected override void LoadContent()
        {
            texture = Game.Content.Load<Texture2D>(@"Buildings\SimpleTower");
            base.LoadContent();
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            Rectangle destination = new Rectangle(PositionX * level.BlockSize + level.OffsetX, PositionY * level.BlockSize + level.OffsetY, level.BlockSize, level.BlockSize);
            Game.SpriteBatch.Draw(texture, destination, Color.White);
            base.Draw(gameTime);
        }
    }
}
